/*matrix.hpp
#include <iostream>
#include <cstring>

using namespace std;

class Matrix {
public:
        Matrix() :rows(0), cols(0), data(NULL) {}
        Matrix(int rows, int cols) :rows(rows), cols(cols) {
                data = new int[rows * cols];
        }
        Matrix(const Matrix& other) {
                this->rows = other.rows;
                this->cols = other.cols;
                this->data = new int[rows * cols];
                memcpy(this->data, other.data, rows * cols * sizeof(int));
        }
        ~Matrix() {
                delete[] data;
        }
        Matrix operator ++(int);
        Matrix& operator ++();
        Matrix& operator=(const Matrix& other);
        void input() {
                for (int i = 0; i < rows * cols; i++)
                        cin >> data[i];
        }
        void output() {
                for (int i = 0; i < rows; i++) {
                        for (int j = 0; j < cols; j++) {
                                int idx = i * cols + j;
                                cout << data[idx] << " ";
                        }
                        cout << endl;
                }
        }
private:
        int rows, cols;
        int* data;
};
*/

#include <iostream>

#include "matrix.hpp"

using namespace std;

Matrix Matrix::operator++(int) {
    Matrix temp(*this);
    for (int i = 0; i < rows * cols; i++)
        data[i]++;
    return temp;
}

Matrix& Matrix::operator++() {
    for (int i = 0; i < rows * cols; i++)
        data[i]++;
    return *this;
}

Matrix& Matrix::operator=(const Matrix& other) {
    if (this != &other) {
        delete[] data;
        this->rows = other.rows;
        this->cols = other.cols;
        this->data = new int[rows * cols];
        memcpy(this->data, other.data, rows * cols * sizeof(int));
    }
    return *this;
}